package com.transitionseverywhere.utils;

import android.animation.ValueAnimator;
import android.graphics.PointF;
import java.lang.ref.WeakReference;

/* loaded from: classes.dex */
public abstract class BasePointFAnimator extends ValueAnimator implements ValueAnimator.AnimatorUpdateListener {
    private PointFProperty mPointFProperty;
    private WeakReference mTarget;
    private PointF mTempPointF = new PointF();

    protected abstract void applyAnimatedFraction(PointF pointF, float f);

    /* JADX INFO: Access modifiers changed from: protected */
    public BasePointFAnimator(Object obj, PointFProperty pointFProperty) {
        this.mTarget = new WeakReference(obj);
        this.mPointFProperty = pointFProperty;
        setFloatValues(0.0f, 1.0f);
        addUpdateListener(this);
    }

    @Override // android.animation.ValueAnimator.AnimatorUpdateListener
    public void onAnimationUpdate(ValueAnimator valueAnimator) {
        Object obj = this.mTarget.get();
        if (obj == null) {
            cancel();
            return;
        }
        applyAnimatedFraction(this.mTempPointF, valueAnimator.getAnimatedFraction());
        this.mPointFProperty.set(obj, this.mTempPointF);
    }
}
